// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import "../Components"

AndroidItem {
    id: _root
    width: 720 * viewScale
    height: 1134 * viewScale

    property string notificationItemNormalPath: ""      //通知アイテム
    property string notificationItemPressedPath: ""     //通知アイテム
    property string notificationTrackingBgPath: ""      //通知背景

    property bool isViewing: false
    property real itemWidth: 720 * viewScale
    property real itemHeight: 128 * viewScale

    property real moveToY: 0    // 移動先
    function moveTo(y){
        if(_anim.running){
            _anim.stop();
        }
        moveToY = y;
        _anim.start();
    }

    //表示
    onVisibleChanged: {

    }

    //背景
    Image{
        width: _root.width
        height: 1008 * viewScale
        source: notificationTrackingBgPath
    }

    Column{
        anchors.bottom: parent.bottom

        //１つめのアイテム
        ImageButton {
            width: itemWidth
            height: itemHeight
            imageIdle: notificationItemNormalPath
            imagePress: notificationItemPressedPath
        }

        //隙間
        Rectangle{
            width: itemWidth
            height: 1
            color: "#000000"
        }

        //２つめのアイテム
        Row{
            Image {
                width: itemHeight
                height: itemHeight
                source: "images/notification_item_icon.png"
            }
            ImageButton {
                width: itemWidth - itemHeight
                height: itemHeight
                imageIdle: notificationItemNormalPath
                imagePress: notificationItemPressedPath
            }
        }
        //下の領域をうめる
        Item{
            width: itemWidth
            height: 138 * viewScale
        }
    }



    //フレーム
    Image{
        anchors.fill: parent
        source: "images/notification_bg.png"
    }


    NumberAnimation {
        id: _anim
        target: _root
        property: "y"
        to: moveToY
        duration: 300
        easing.type: Easing.InOutQuad
        running: false
    }

    MouseArea{
        anchors.fill: parent
        acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
    }
}
